<template>
	<view class="container">
		<view class="top">往期回顾</view>
		<view class="bd">
			<view class="header">协会活动</view>
			<view class="content">
				<view class="item" v-for="item in list" :key="item.id" @click="toDetail(item.id)">
					<view class="left">
						<view class="title">{{item.title}}</view>
						<view class="val">{{item.introduce}}</view>
						<view class="tag">{{item.aname}}</view>
					</view>
					<view class="right">
						<view class="pic">
							<img :src="item.eimg" alt="" srcset="">
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getHistoryData
	} from '@/api/xiehui.js'
	export default {
		data() {
			return {
				query: {
					limit: 10,
					page: 1
				},
				list: [],
			}
		},
		onShow() {
			this.getData();
		},
		methods: {
			toDetail(id){
				console.log(id);
				uni.navigateTo({
					url:'/pages/activeCenter/detail?id='+id
				})
			},
			getData() {
				getHistoryData(this.query).then((res) => {
					this.list = res.data;
				})
			},
		},
	}
</script>

<style lang="scss">
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
		color: #171717;

	}

	img {
		width: 100%;
		height: 100%;
	}

	.container {
		padding: 30rpx;
		background-color: #fff;
		overflow-y: auto;

		.top {
			height: 54rpx;
			margin-bottom: 60rpx;
			line-height: 54rpx;
			color: #333333;
			font-weight: bold;
			font-size: 34rpx;
			background-color: #fff;
		}

		.bd {

			background-color: #fff;

			.header {
				display: flex;
				align-items: center;
				height: 56rpx;
				margin-bottom: 22rpx;
				line-height: 56rpx;
				font-size: 40rpx;
				font-weight: bold;
			}

			.header::before {
				content: '';
				display: inline-block;
				width: 8rpx;
				height: 40rpx;
				margin-right: 17rpx;
				border-radius: 50rpx;
				background: linear-gradient(180deg, #1E80FD, #53A6FF);
				line-height: 56rpx;
			}


			.item {
				display: flex;
				height: 280rpx;
				padding: 35rpx 0;
				border-bottom: 1rpx solid #DFDFDF;

				&:last-child {
					border: none;
				}

				.left {
					flex: 1;

					.title {
						font-size: 34rpx;
						font-weight: 500;
						margin-bottom: 22rpx;
					}

					.val {
						height: 117rpx;
						font-size: 28rpx;
						word-break: break-all;
						overflow: hidden;
					}

					.tag {
						font-size: 24rpx;
						color: #868D93;

					}
				}

				.right {

					display: flex;
					align-items: flex-end;
					justify-content: flex-end;
					width: 290rpx;
					height: 100%;
					flex-shrink: 0;

					.pic {
						width: 228rpx;
						height: 185rpx;
						border-radius: 12rpx;
						overflow: hidden;

						img {
							background-color: #ccc;

						}
					}

				}
			}


		}

	}
</style>
